import { axios } from '@/utils/request'

const api = {
  getPageList: '/adminapi/page/pageList',
  getPageDetail: '/adminapi/page/pageDetail',
  editPageContent: '/adminapi/page/editPageContent',
  addPageContent: '/adminapi/page/addPageContent',
  getContentDetail: '/adminapi/page/contentDetail',
  getContentList: '/adminapi/page/contentList',
  urlPickerList: '/adminapi/page/urlPickerList',
  setContentRank: '/adminapi/page/setContentRank',
  deleteContent: '/adminapi/page/contentDelete',
}

export default api

export function getPageList(parameter) {
  return axios({
    url: api.getPageList,
    method: 'get',
    params: parameter
  })
}
export function getContentDetail(parameter) {
  return axios({
    url: api.getContentDetail,
    method: 'get',
    params: parameter
  })
}
export function getPageDetail(parameter) {
  return axios({
    url: api.getPageDetail,
    method: 'get',
    params: parameter
  })
}

export function urlPickerList(parameter) {
  return axios({
    url: api.urlPickerList,
    method: 'get',
    params: parameter
  })
}

export function getContentList(parameter) {
  return axios({
    url: api.getContentList,
    method: 'get',
    params: parameter
  })
}

export function editPageContent(parameter) {
  return axios({
    url: api.editPageContent,
    method: 'post',
    data: parameter
  })
}

export function addPageContent(parameter) {
  return axios({
    url: api.addPageContent,
    method: 'post',
    data: parameter
  })
}

export function setContentRank(parameter) {
  return axios({
    url: api.setContentRank,
    method: 'post',
    data: parameter
  })
}
export function deleteContent(parameter) {
  return axios({
    url: api.deleteContent,
    method: 'post',
    data: parameter
  })
}